home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- #
- # DHCP D-Bus daemon
- #
- # Author: Michael Biebl <biebl@debian.org>
- #
-
- set -e
-
- PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
- DESC="DHCP D-Bus daemon"
- NAME="dhcdbd"
- DAEMON=/usr/sbin/$NAME
- DAEMON_OPTS=--system
- PIDFILE=/var/run/$NAME.pid
- SCRIPTNAME=/etc/dbus-1/event.d/24$NAME
-
- # Gracefully exit if the package has been removed.
- test -x $DAEMON || exit 0
-
- . /lib/lsb/init-functions
-
- #
- # Function that starts the daemon/service.
- #
- d_start() {
- start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --exec $DAEMON -- $DAEMON_OPTS
- }
-
- #
- # Function that stops the daemon/service.
- #
- d_stop() {
- start-stop-daemon --stop --quiet --pidfile $PIDFILE \
- --oknodo --retry 60 --exec $DAEMON
- }
-
-
- case "$1" in
- start)
- log_daemon_msg "Starting $DESC" "$NAME"
- d_start
- log_end_msg $?
- ;;
- stop)
- log_daemon_msg "Stopping $DESC" "$NAME"
- d_stop
- log_end_msg $?
- ;;
- restart|force-reload)
- log_daemon_msg "Restarting $DESC" "$NAME"
- d_stop
- d_start
- log_end_msg $?
- ;;
- *)
- echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
- exit 1
- ;;
- esac
-
- exit 0
-